package org.dizem.groupon.action;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
import org.apache.log4j.Logger;
import org.dizem.groupon.model.Stats;
import org.dizem.groupon.service.CommonService;

/**
 * User: dizem@126.com
 * Time: 11-9-1 下午4:15
 */
public class CommonAction extends ActionSupport implements Preparable {
	private static final Logger log = Logger.getLogger(CommonAction.class);

	private CommonService service;
	private Stats stats;

	public Stats getStats() {
		return stats;
	}

	public void setStats(Stats stats) {
		this.stats = stats;
	}

	public CommonService getService() {
		return service;
	}

	public String stats() throws Exception {
		stats = service.getStats();
		log.info(stats);
		return SUCCESS;
	}

	public void setService(CommonService service) {
		this.service = service;
	}

	public void prepare() throws Exception {
		stats = service.getStats();
	}
}
